<!-- 菜单弹框 -->
<form id="menus-form" lay-filter="menus-form" class="layui-form model-form">
    <input name="actiid" type="hidden"/>
    <div class="layui-form-item">
        <label class="layui-form-label">减免金额</label>
        <div class="layui-input-block">
            <input name="reduce" placeholder="请输入减免金额" type="text" class="layui-input"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">活动详情</label>
        <div class="layui-input-block">
            <input name="remark" placeholder="活动详情" type="text" class="layui-input"/>
        </div>
    </div>
    <div class="layui-form-item model-form-footer">
        <button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">取消</button>
        <button class="layui-btn" lay-filter="menus-form-submit" lay-submit>保存</button>
    </div>
</form>

<script>
    layui.use(['layer', 'admin','config', 'form', 'formSelects','upload'],function () {
        var layer = layui.layer;
        var admin = layui.admin;
        var config = layui.config;
        var form = layui.form;
        var formSelects = layui.formSelects;
        var upload=layui.upload;

		debugger ;
        form.render('radio');
        // 回显user数据
        var menus = admin.getTempData('t_menus');
        console.log(menus);
        $('#menus-form').attr('method', 'POST');
        if (menus) {

            form.val('menus-form', menus);
            $('#menus-form').attr('method', 'POST');
        }
        // 表单提交事件
        form.on('submit(menus-form-submit)', function (data) {
            layer.load(2);
            admin.req('api-administrators/platformActivity/add', JSON.stringify(data.field), function (data) {
                
                if (data.code == 0) {
                	layer.closeAll('loading');
                    layer.msg(data.msg, {icon: 1, time: 500});
                    admin.finishPopupCenter();
                } else {
                	layer.closeAll('loading');
                    layer.msg(data.msg, {icon: 2, time: 500});
                }
            }, $('#menus-form').attr('method'));
            return false;
        });


    });
</script>